#ifndef ABSTRACT_H
#define ABSTRACT_H

#include "mtime.h"
#include "Vector2.h"
#include "GameConstants.h"
#include "debug.h"

enum type { BLACKHOLE, STAR, PLANET, MISSILE, EXPLOSIONEFFECT, DAMAGEWIDGET };

class color
{
public:
	color(unsigned char p_red, unsigned char p_green,unsigned char p_blue,unsigned char p_alpha)
	{
		red = p_red;
		green = p_green;
		blue = p_blue;
		alpha = p_alpha;
	}
	color()
	{
		red = 0;
		green = 0;
		blue = 0;
		alpha = 0;
	}
	unsigned char red;
	unsigned char green;
	unsigned char blue;
	unsigned char alpha;
};


class Abstract {
public:
	Abstract(type p_type, Vector2 p_position, color p_color)
	{
		m_birth_time = mtime();
		m_color = p_color;
		m_position = p_position;
		m_type = p_type;
	}
	Vector2 getPosition() const
	{
		return m_position;
	}
	type getType() const
	{
		return m_type;
	}
	color getColor() const
	{
		return m_color;
	}
	virtual void tick()
	{ }
	int getAge() const
	{
		return mtime()-m_birth_time;
	}
protected:
	type m_type;
	Vector2 m_position;
	int m_birth_time;
	color m_color;
};
	
#endif
